<template>
  <!--        class="bm-view" :zoom="15" :center="{lng: 118.337962, lat: 35.050618}" inertial-dragging @ready="mapReady"-->
  <div>

    <!--    <vue-simple-spinner size="medium"/>-->
    <baidu-map class="bm-view"
               :zoom="15" :center="center" inertial-dragging @ready="mapReady" :scroll-wheel-zoom="true">
      <bm-control id="searAdressBox">
        <div class="botTE">
          <div class="botTE_t">
            设备图例
          </div>
          <div class="img_F">
            <div class="img_M">
              <img class="imggg" src="../../assets/a2.svg">
            </div>
            <div class="text_T">电流</div>
            <div class="img_M">
              <img class="imggg" src="../../assets/z139.svg">
            </div>
            <div class="text_T">除湿器</div>
            <div class="img_M">
              <img class="imggg" src="../../assets/z142.svg">
            </div>
            <div class="text_T">震动</div>
            <div class="img_M">
              <img class="imggg" src="../../assets/z156.svg">
            </div>
            <div class="text_T">局放</div>
            <div class="img_M">
              <img class="imggg" src="../../assets/z161.svg">
            </div>
            <div class="text_T">湿度</div>
            <div class="img_M">
              <img class="imggg" src="../../assets/z166.svg">
            </div>
            <div class="text_T">温度</div>

          </div>
        </div>
      </bm-control>
      <bm-control id="searAdressBox2">
        <div class="botTE2">
          <div class="botTE_t2">
            状态图例
          </div>
          <div class="imgg">
            <div class="img_sun1">
              <!--              <img class="img" src="../assets/a2.svg">-->
            </div>
            <div class="text_sun">正常</div>
          </div>
          <div class="imgg">
            <div class="img_sun2">
              <!--              <img class="img" src="../assets/a2.svg">-->
            </div>
            <div class="text_sun">预警</div>
          </div>
          <div class="imgg">
            <div class="img_sun3">
              <!--              <img class="img" src="../assets/a2.svg">-->
            </div>
            <div class="text_sun">告警</div>
          </div>
        </div>
      </bm-control>
      <bm-control id="searAdressBox3">
        <div class="botTE2">
          <div class="swich">
            <el-select v-model="valuee" placeholder="请选择">
              <el-option
                  v-for="item in options"
                  :key="item.valuee"
                  :label="item.label"
                  :value="item.valuee"
                  @click.native="selectOK"
              >
              </el-option>
            </el-select>
          </div>
        </div>
      </bm-control>
      <bm-control anchor="BMAP_ANCHOR_BOTTOM_RIGHT" class="yX">
        <div class="d1" @click="dC1">
          <div>全部</div>
        </div>
        <div class="d2" @click="dC2">
          <div>正常</div>
        </div>
        <div class="d3" @click="dC3">
          <div>预警</div>
        </div>
        <div class="d4" @click="dC4">
          <div>告警</div>
        </div>
      </bm-control>
      <bm-marker :position="{lng: 118.337962, lat: 35.050618}">
        <!--          <img src="../assets/a1.svg">-->
      </bm-marker>
      <!--      图标-->
      <bm-marker v-for="item in list_center"
                 :position="{lng: item.lng, lat: item.lat}"
                 :icon="{url:item.img, size: {width: 20, height: 20}}" @click="lookDetail(item)">
        <bm-info-window :show="item.show" @close="infoWindowClose(item)">
            <div class="div0">设备名称{{ item.name }}</div>
            <div style="color: red" class="div1">{{ item.state }}</div>
            <div style="color: #44D278" class="div2">{{ item.stat }}</div>
            <div class="div3">温度{{ item.temp }}</div>
        </bm-info-window>
      </bm-marker>


      <!--      &lt;!&ndash; 定位控件   anchor="BMAP_ANCHOR_BOTTOM_RIGHT"代表放在右下角 &ndash;&gt;-->
      <!--      <bm-geolocation
                anchor="BMAP_ANCHOR_BOTTOM_RIGHT"
                :showAddressBar="true"
                :autoLocation="true"></bm-geolocation>-->

      <!-- 地区检索  keyword：关键字搜索   @searchcomplete：检索完成后的回调函数   auto-viewport：检索结束后是否自动调整地图事业  -->
      <!--      <bm-local-search
                :keyword="keyword"
                @searchcomplete="search"
                :auto-viewport="true"
                class="search" ></bm-local-search>-->
    </baidu-map>
  </div>
</template>


<script>


//引入组件
import {
  BaiduMap,
  BmControl,
  BmView,
  BmAutoComplete,
  BmLocalSearch,
  BmMarker,
  BmGeolocation,
} from "vue-baidu-map";
import mapIconPath from "../../assets/a1.svg"
import mapIconPath3 from "../../assets/b2.svg"
import mapIconPath2 from "../../assets/a2.svg"
import VueSimpleSpinner from 'vue-simple-spinner'
import new_list from "@/components/new_list/new_list";

export default {
  data() {

    return {
      showWindows: false,
      Visiable: false,
      number: 0,
      mapIcon: mapIconPath,
      mapIcon2: mapIconPath2,
      mapIcon3: mapIconPath3,
      active: false,
      show: false,
      valuee: '厂房一',
      // center: [{lng: 118.337962, lat: 35.050618},
      center: {lng: 118.337962, lat: 35.050618},
      //检索关键字
      keyword: "",

      //输入框input值
      input3: "",
      options: [{valuee: '厂房一', label: '厂房一'}, {valuee: '厂房二', label: '厂房二'}],
      list_center: [
        {
          lng: 118.337999,
          lat: 35.041433,
          img: mapIconPath,
          state: '超限告警',
          name: '001',
          stat: '设备在线',
          temp: '66℃',
          show: false,
        },
        {
          lng: 118.337999,
          lat: 35.041133,
          img: mapIconPath,
          state: '超限告警',
          name: '001',
          stat: '设备在线',
          temp: '66℃',
          show: false,
        },
        {
          lng: 118.3347999,
          lat: 35.042633,
          img: mapIconPath,
          state: '超限告警',
          name: '001',
          stat: '设备在线',
          temp: '66℃',
          show: false,
        },
        {
          lng: 118.337999,
          lat: 35.041433,
          img: mapIconPath2,
          state: '正常',
          name: '001',
          stat: '设备在线',
          temp: '66℃',
          show: false,
        },
        {
          lng: 118.33372222,
          lat: 35.04146666,
          img: mapIconPath2,
          state: '正常',
          name: '001',
          stat: '设备在线',
          temp: '66℃',
          show: false,
        },
        {
          lng: 118.3371224,
          lat: 35.04149956,
          img: mapIconPath2,
          state: '正常',
          name: '001',
          stat: '设备在线',
          temp: '66℃',
          show: false,
        }, {
          lng: 118.3371224,
          lat: 35.040149956,
          img: mapIconPath2,
          state: '正常',
          name: '001',
          stat: '设备在线',
          temp: '66℃',
          show: false,
        }, {
          lng: 118.3371224,
          lat: 35.04149956,
          img: mapIconPath2,
          state: '正常',
          name: '001',
          stat: '设备在线',
          temp: '66℃',
          show: false,
        }, {
          lng: 118.3333371224,
          lat: 35.04149956,
          img: mapIconPath3,
          state: '预警',
          name: '001',
          stat: '设备在线',
          temp: '66℃',
          show: false,
        }, {
          lng: 118.332271224,
          lat: 35.034149956,
          img: mapIconPath3,
          state: '预警',
          name: '001',
          stat: '设备在线',
          temp: '66℃',
          show: false,
        }, {
          lng: 118.33891224,
          lat: 35.04149956,
          img: mapIconPath3,
          state: '预警',
          name: '001',
          stat: '设备在线',
          temp: '66℃',
          show: false,
        }],
    };
  },
  //需要引入的组件
  components: {
    BaiduMap,
    BmControl,
    BmView,
    BmAutoComplete,
    BmLocalSearch,
    BmMarker,
    BmGeolocation,
    VueSimpleSpinner,
    new_list
  },
  methods: {
    hello_World(message) {
      this.message = message;
      // this.$message = message;
      console.log(message)
      if (message === '厂房一') {
        this.center = {lng: 118.337962, lat: 35.050618};
        this.list_center =
            [{
              lng: 118.337999,
              lat: 35.041433,
              img: mapIconPath,
              state: '告警',
              name: '001',
              stat: '设备在线',
              temp: '66℃',
              show: false,
            },
              {
                lng: 118.337999,
                lat: 35.041133,
                img: mapIconPath,
                state: '告警',
                name: '001',
                stat: '设备在线',
                temp: '66℃',
                show: false,
              },
              {
                lng: 118.3347999,
                lat: 35.042633,
                img: mapIconPath,
                state: '告警',
                name: '001',
                stat: '设备在线',
                temp: '66℃',
                show: false,
              },
              {
                lng: 118.337999,
                lat: 35.041433,
                img: mapIconPath2,
                state: '正常',
                name: '001',
                stat: '设备在线',
                temp: '66℃',
                show: false,
              },
              {
                lng: 118.33372222,
                lat: 35.04146666,
                img: mapIconPath2,
                state: '正常',
                name: '001',
                stat: '设备在线',
                temp: '66℃',
                show: false,
              },
              {
                lng: 118.3371224,
                lat: 35.04149956,
                img: mapIconPath2,
                state: '正常',
                name: '001',
                stat: '设备在线',
                temp: '66℃',
                show: false,
              },
              {
                lng: 118.3371224,
                lat: 35.040149956,
                img: mapIconPath2,
                state: '正常',
                name: '001',
                stat: '设备在线',
                temp: '66℃',
                show: false,
              },
              {
                lng: 118.3371224,
                lat: 35.04149956,
                img: mapIconPath2,
                state: '正常',
                name: '001',
                stat: '设备在线',
                temp: '66℃',
                show: false,
              },
              {
                lng: 118.3333371224,
                lat: 35.04149956,
                img: mapIconPath3,
                state: '预警',
                name: '001',
                stat: '设备在线',
                temp: '66℃',
                show: false,
              },
              {
                lng: 118.332271224,
                lat: 35.034149956,
                img: mapIconPath3,
                state: '预警',
                name: '001',
                stat: '设备在线',
                temp: '66℃',
                show: false,
              },
              {
                lng: 118.33891224,
                lat: 35.04149956,
                img: mapIconPath3,
                state: '预警',
                name: '001',
                stat: '设备在线',
                temp: '66℃',
                show: false,
              }]
      } else if (message === '厂房二') {
        this.center = {lng: 118.337962, lat: 35.040622};
        this.list_center = [
            {
          lng: 118.317963,
          lat: 35.071433,
          img: mapIconPath,
          state: '告警',
          name: '001',
          stat: '设备在线',
          temp: '66℃',
          show: false,
        }, {
          lng: 118.357964,
          lat: 35.031434,
          img: mapIconPath,
          state: '告警',
          name: '001',
          stat: '设备在线',
          temp: '66℃',
          show: false,
        }, {
          lng: 118.537965,
          lat: 35.021435,
          img: mapIconPath3,
          state: '预警',
          name: '001',
          stat: '设备在线',
          temp: '66℃',
          show: false,
        }, {
          lng: 118.397966,
          lat: 35.011436,
          img: mapIconPath2,
          state: '正常',
          name: '001',
          stat: '设备在线',
          temp: '66℃',
          show: false,
        }, {
          lng: 118.307967,
          lat: 35.041438,
          img: mapIconPath3,
          state: '预警',
          name: '001',
          stat: '设备在线',
          temp: '66℃',
          show: false,
        }, {
          lng: 118.317968,
          lat: 35.091432,
          img: mapIconPath3,
          state: '预警',
          name: '001',
          stat: '设备在线',
          temp: '66℃',
          show: false,
        }, {
          lng: 118.367969,
          lat: 35.061431,
          img: mapIconPath3,
          state: '预警',
          name: '001',
          stat: '设备在线',
          temp: '66℃',
          show: false,
        }, {
          lng: 118.327970,
          lat: 35.041437,
          img: mapIconPath2,
          state: '正常',
          name: '001',
          stat: '设备在线',
          temp: '66℃',
          show: false,
        }, {
          lng: 118.307971,
          lat: 35.041438,
          img: mapIconPath2,
          state: '正常',
          name: '001',
          stat: '设备在线',
          temp: '66℃',
          show: false,
        }, {
          lng: 118.377972,
          lat: 35.021433,
          img: mapIconPath2,
          state: '正常',
          name: '001',
          stat: '设备在线',
          temp: '66℃',
          show: false,
        },]
      } else {
        this.center = {lng: 118.337962, lat: 35.010633}
      }
    },

    selectOK() {
      // console.log(valuee)
      if (this.valuee === '厂房一') {
        this.center = {lng: 118.337962, lat: 35.050618};
        this.list_center =
            [{
              lng: 118.337999,
              lat: 35.041433,
              img: mapIconPath,
              state: '告警',
              name: '001',
              stat: '设备在线',
              temp: '66℃',
              show: false,
            },
              {
                lng: 118.337999,
                lat: 35.041133,
                img: mapIconPath,
                state: '告警',
                name: '001',
                stat: '设备在线',
                temp: '66℃',
                show: false,
              },
              {
                lng: 118.3347999,
                lat: 35.042633,
                img: mapIconPath,
                state: '告警',
                name: '001',
                stat: '设备在线',
                temp: '66℃',
                show: false,
              },
              {
                lng: 118.337999,
                lat: 35.041433,
                img: mapIconPath2,
                state: '正常',
                name: '001',
                stat: '设备在线',
                temp: '66℃',
                show: false,
              },
              {
                lng: 118.33372222,
                lat: 35.04146666,
                img: mapIconPath2,
                state: '正常',
                name: '001',
                stat: '设备在线',
                temp: '66℃',
                show: false,
              },
              {
                lng: 118.3371224,
                lat: 35.04149956,
                img: mapIconPath2,
                state: '正常',
                name: '001',
                stat: '设备在线',
                temp: '66℃',
                show: false,
              },
              {
                lng: 118.3371224,
                lat: 35.040149956,
                img: mapIconPath2,
                state: '正常',
                name: '001',
                stat: '设备在线',
                temp: '66℃',
                show: false,
              },
              {
                lng: 118.3371224,
                lat: 35.04149956,
                img: mapIconPath2,
                state: '正常',
                name: '001',
                stat: '设备在线',
                temp: '66℃',
                show: false,
              },
              {
                lng: 118.3333371224,
                lat: 35.04149956,
                img: mapIconPath3,
                state: '预警',
                name: '001',
                stat: '设备在线',
                temp: '66℃',
                show: false,
              },
              {
                lng: 118.332271224,
                lat: 35.034149956,
                img: mapIconPath3,
                state: '预警',
                name: '001',
                stat: '设备在线',
                temp: '66℃',
                show: false,
              },
              {
                lng: 118.33891224,
                lat: 35.04149956,
                img: mapIconPath3,
                state: '预警',
                name: '001',
                stat: '设备在线',
                temp: '66℃',
                show: false,
              }]
      } else if (this.valuee === '厂房二') {
        this.center = {lng: 118.337962, lat: 35.040622};
        this.list_center = [{
          lng: 118.317963,
          lat: 35.071433,
          img: mapIconPath,
          state: '告警',
          name: '001',
          stat: '设备在线',
          temp: '66℃',
          show: false,
        }, {
          lng: 118.357964,
          lat: 35.031434,
          img: mapIconPath,
          state: '告警',
          name: '001',
          stat: '设备在线',
          temp: '66℃',
          show: false,
        }, {
          lng: 118.537965,
          lat: 35.021435,
          img: mapIconPath3,
          state: '预警',
          name: '001',
          stat: '设备在线',
          temp: '66℃',
          show: false,
        }, {
          lng: 118.397966,
          lat: 35.011436,
          img: mapIconPath2,
          state: '正常',
          name: '001',
          stat: '设备在线',
          temp: '66℃',
          show: false,
        }, {
          lng: 118.307967,
          lat: 35.041438,
          img: mapIconPath3,
          state: '预警',
          name: '001',
          stat: '设备在线',
          temp: '66℃',
          show: false,
        }, {
          lng: 118.317968,
          lat: 35.091432,
          img: mapIconPath3,
          state: '预警',
          name: '001',
          stat: '设备在线',
          temp: '66℃',
          show: false,
        }, {
          lng: 118.367969,
          lat: 35.061431,
          img: mapIconPath3,
          state: '预警',
          name: '001',
          stat: '设备在线',
          temp: '66℃',
          show: false,
        }, {
          lng: 118.327970,
          lat: 35.041437,
          img: mapIconPath2,
          state: '正常',
          name: '001',
          stat: '设备在线',
          temp: '66℃',
          show: false,
        }, {
          lng: 118.307971,
          lat: 35.041438,
          img: mapIconPath2,
          state: '正常',
          name: '001',
          stat: '设备在线',
          temp: '66℃',
          show: false,
        }, {
          lng: 118.377972,
          lat: 35.021433,
          img: mapIconPath2,
          state: '正常',
          name: '001',
          stat: '设备在线',
          temp: '66℃',
          show: false,
        },]

      } else {
        this.center = {lng: 118.337962, lat: 35.010633}
      }
    },
    //全部
    dragMove(a, b) {
      a = this.center.lng
      b = this.center.lat
      this.center = {lng: a++, lat: b++}
    },
    //告警
    dC1() {
      if (this.$data.valuee === '厂房一') {
        this.list_center =
            //告警
            [{
              lng: 118.337999,
              lat: 35.041433,
              img: mapIconPath,
              state: '告警',
              name: '001',
              stat: '设备在线',
              temp: '66℃',
              show: false,
            },
              {
                lng: 118.337999,
                lat: 35.041133,
                img: mapIconPath,
                state: '告警',
                name: '001',
                stat: '设备在线',
                temp: '66℃',
                show: false,
              },
              {
                lng: 118.3347999,
                lat: 35.042633,
                img: mapIconPath,
                state: '告警',
                name: '001',
                stat: '设备在线',
                temp: '66℃',
                show: false,
              },
              // 正常
              {
                lng: 118.337999,
                lat: 35.041433,
                img: mapIconPath2,
                state: '告警',
                name: '001',
                stat: '设备在线',
                temp: '66℃',
                show: false,
              },
              {
                lng: 118.33372222,
                lat: 35.04146666,
                img: mapIconPath2,
                state: '告警',
                name: '001',
                stat: '设备在线',
                temp: '66℃',
                show: false,
              },
              {
                lng: 118.3371224,
                lat: 35.04149956,
                img: mapIconPath2,
                state: '告警',
                name: '001',
                stat: '设备在线',
                temp: '66℃',
                show: false,
              },
              {
                lng: 118.3371224,
                lat: 35.040149956,
                img: mapIconPath2,
                state: '告警',
                name: '001',
                stat: '设备在线',
                temp: '66℃',
                show: false,
              },
              {
                lng: 118.3371224,
                lat: 35.04149956,
                img: mapIconPath2,
                state: '告警',
                name: '001',
                stat: '设备在线',
                temp: '66℃',
                show: false,
              },
              //预警
              {
                lng: 118.3333371224,
                lat: 35.04149956,
                img: mapIconPath3,
                state: '告警',
                name: '001',
                stat: '设备在线',
                temp: '66℃',
                show: false,
              },
              {
                lng: 118.332271224,
                lat: 35.034149956,
                img: mapIconPath3,
                state: '告警',
                name: '001',
                stat: '设备在线',
                temp: '66℃',
                show: false,
              },
              {
                lng: 118.33891224,
                lat: 35.04149956,
                img: mapIconPath3,
                state: '告警',
                name: '001',
                stat: '设备在线',
                temp: '66℃',
                show: false,
              }]
      } else if (this.$data.valuee === '厂房二') {
        console.log("第二个")
        // this.center = {lng: 118.337962, lat: 35.050618};
        this.list_center = [
          {
            lng: 118.317963,
            lat: 35.071433,
            img: mapIconPath,
            state: '告警',
            name: '001',
            stat: '设备在线',
            temp: '66℃',
            show: false,
          }, {
            lng: 118.357964,
            lat: 35.031434,
            img: mapIconPath,
            state: '告警',
            name: '001',
            stat: '设备在线',
            temp: '66℃',
            show: false,
          }, {
            lng: 118.537965,
            lat: 35.021435,
            img: mapIconPath3,
            state: '告警',
            name: '001',
            stat: '设备在线',
            temp: '66℃',
            show: false,
          }, {
            lng: 118.307967,
            lat: 35.041438,
            img: mapIconPath3,
            state: '告警',
            name: '001',
            stat: '设备在线',
            temp: '66℃',
            show: false,
          }, {
            lng: 118.317968,
            lat: 35.091432,
            img: mapIconPath3,
            state: '告警',
            name: '001',
            stat: '设备在线',
            temp: '66℃',
            show: false,
          }, {
            lng: 118.367969,
            lat: 35.061431,
            img: mapIconPath3,
            state: '告警',
            name: '001',
            stat: '设备在线',
            temp: '66℃',
            show: false,
          }, {
            lng: 118.327970,
            lat: 35.041437,
            img: mapIconPath2,
            state: '告警',
            name: '001',
            stat: '设备在线',
            temp: '66℃',
            show: false,
          }, {
            lng: 118.307971,
            lat: 35.041438,
            img: mapIconPath2,
            state: '告警',
            name: '001',
            stat: '设备在线',
            temp: '66℃',
            show: false,
          }, {
            lng: 118.377972,
            lat: 35.021433,
            img: mapIconPath2,
            state: '告警',
            name: '001',
            stat: '设备在线',
            temp: '66℃',
            show: false,
          }, {
            lng: 118.397966,
            lat: 35.011436,
            img: mapIconPath2,
            state: '告警',
            name: '001',
            stat: '设备在线',
            temp: '66℃',
            show: false,
          },]
      }
    },
    //正常
    dC4() {
      if (this.$data.valuee === '厂房一') {
        this.list_center = [{
          lng: 118.337999,
          lat: 35.041433,
          img: mapIconPath,
          state: '告警',
          name: '001',
          stat: '设备在线',
          temp: '66℃',
          show: false,
        },
          {
            lng: 118.337999,
            lat: 35.041133,
            img: mapIconPath,
            state: '告警',
            name: '001',
            stat: '设备在线',
            temp: '66℃',
            show: false,
          },
          {
            lng: 118.3347999,
            lat: 35.042633,
            img: mapIconPath,
            state: '告警',
            name: '001',
            stat: '设备在线',
            temp: '66℃',
            show: false,
          },]
      } else if (this.$data.valuee === '厂房二') {
        this.list_center = [{
          lng: 118.317963,
          lat: 35.071433,
          img: mapIconPath,
          state: '告警',
          name: '001',
          stat: '设备在线',
          temp: '66℃',
          show: false,
        }, {
          lng: 118.357964,
          lat: 35.031434,
          img: mapIconPath,
          state: '告警',
          name: '001',
          stat: '设备在线',
          temp: '66℃',
          show: false,
        }]
      }
    },
    //预警
    dC2() {
      if (this.$data.valuee === '厂房一') {
        this.list_center =
            [{
              lng: 118.337999,
              lat: 35.041433,
              img: mapIconPath2,
              state: '正常',
              name: '001',
              stat: '设备在线',
              temp: '66℃',
              show: false,
            },
              {
                lng: 118.33372222,
                lat: 35.04146666,
                img: mapIconPath2,
                state: '正常',
                name: '001',
                stat: '设备在线',
                temp: '66℃',
                show: false,
              },
              {
                lng: 118.3371224,
                lat: 35.04149956,
                img: mapIconPath2,
                state: '正常',
                name: '001',
                stat: '设备在线',
                temp: '66℃',
                show: false,
              }, {
              lng: 118.3371224,
              lat: 35.040149956,
              img: mapIconPath2,
              state: '正常',
              name: '001',
              stat: '设备在线',
              temp: '66℃',
              show: false,
            },]
      } else if (this.$data.valuee === '厂房二') {
        this.list_center =
            [{
              lng: 118.327970,
              lat: 35.041437,
              img: mapIconPath2,
              state: '告警',
              name: '001',
              stat: '设备在线',
              temp: '66℃',
              show: false,
            }, {
              lng: 118.307971,
              lat: 35.041438,
              img: mapIconPath2,
              state: '告警',
              name: '001',
              stat: '设备在线',
              temp: '66℃',
              show: false,
            }, {
              lng: 118.377972,
              lat: 35.021433,
              img: mapIconPath2,
              state: '告警',
              name: '001',
              stat: '设备在线',
              temp: '66℃',
              show: false,
            }, {
              lng: 118.397966,
              lat: 35.011436,
              img: mapIconPath2,
              state: '告警',
              name: '001',
              stat: '设备在线',
              temp: '66℃',
              show: false,
            },]
      }
    },

    dC3() {
      if (this.$data.valuee === '厂房一') {
        this.list_center = [{
          lng: 118.3333371224,
          lat: 35.04149956,
          img: mapIconPath3,
          state: '告警',
          name: '001',
          stat: '设备在线',
          temp: '66℃',
          show: false,
        }, {
          lng: 118.332271224,
          lat: 35.034149956,
          img: mapIconPath3,
          state: '告警',
          name: '001',
          stat: '设备在线',
          temp: '66℃',
          show: false,
        }, {
          lng: 118.33891224,
          lat: 35.04149956,
          img: mapIconPath3,
          state: '告警',
          name: '001',
          stat: '设备在线',
          temp: '66℃',
          show: false,
        },]
      } else if (this.$data.valuee === '厂房二') {
        this.list_center = [{
          lng: 118.307967,
          lat: 35.041438,
          img: mapIconPath3,
          state: '告警',
          name: '001',
          stat: '设备在线',
          temp: '66℃',
          show: false,
        }, {
          lng: 118.317968,
          lat: 35.091432,
          img: mapIconPath3,
          state: '告警',
          name: '001',
          stat: '设备在线',
          temp: '66℃',
          show: false,
        }, {
          lng: 118.367969,
          lat: 35.061431,
          img: mapIconPath3,
          state: '告警',
          name: '001',
          stat: '设备在线',
          temp: '66℃',
          show: false,
        }]
      }
    },
    lookDetail(item) {
      item.show = true
      console.log("测试点击" + item.show)

    },
// 关闭弹窗
    infoWindowClose(item) {
      item.show = false
      console.log("测试关闭" + item.show)
    },
// 打开弹窗
//     infoWindowOpen() {
//       this.showWindows = true
//     },

    //地图加载后的回调
    mapReady({BMap, map}) {
      let that = this;
      that.map = map;
      map.setMapStyleV2({
        styleId: '8636d8367c807021ec4561ccaf4d8be7'
      });
      //保存this指向，因为在百度的回调中this不指向vue
      const _this = this;
      // 获取自动定位方法
      var geolocation = new BMap.Geolocation();
      // 获取自动定位获取的坐标信息
      /*  geolocation.getCurrentPosition(
          function (r) {
            _this.center = {
              lng: r.point.lng,
              lat: r.point.lat,
            };
            console.log(this.center)
          },
          //启用高精度
          {enableHighAccuracy: true}
          );
      * */
    },
  },
};
</script>


<style lang="scss" scoped>
//自定义的信息窗口样式
.BMap_pop {
  > div,
  > img:nth-child(10) {
    display: none;
    overflow: unset;
  }

  > div:nth-child(9) {
    display: block;
    overflow: unset;
    min-width: 320px !important;
  }

  > div:nth-child(8) {
    /*display: block;*/
  }

  .BMap_top {
    display: none;
  }

  .BMap_center {
    background: transparent;
    border: none;
    position: sticky !important;
    height: 100%;
  }
}

.BMap_bubble_content {
  background: rgba(255, 255, 255, 1);
  box-shadow: 0px 0px 8px 0px rgba(0, 14, 38, 0.2);
  border-radius: 5px;
  padding: 20px;

  .info-window {
    width: 100%;
    height: 20vh;
    background: red;
  }
}
</style>
<style lang="scss" scoped>
.img_M {
  height: 7vh;
}

.img_F {
  display: flex;
  width: 60vh;
}

.botTE_t {
  width: 10vh;
  height: 4vh;
  font-size: 1.8vh;
  font-family: Source Han Sans CN-Regular, Source Han Sans CN;
  font-weight: 400;
  color: #00FFF7;
  text-align: center;
}

.botTE {
  margin-top: 1.5vh;
  font-family: Source Han Sans CN-Regular, Source Han Sans CN;
  font-weight: 400;
  color: #FFFFFF;
  display: flex;
  width: 100%;
}

#searAdressBox {
  position: absolute;
  top: vh(445.2) !important;
  right: 1vh !important;
  left: 1vh !important;
  bottom: auto !important;
  z-index: 1000;
  width: 80%;
  height: 5vh;
  background-color: #000E48;
  border-radius: 10px 10px 10px 10px;

}


</style>
<style scoped lang="scss">

.BMap_cpyCtrl {
  display: none;
}

.anchorBL {
  display: none;
}


.botTE_t2 {
  font-size: 1.5vh;
  font-family: Source Han Sans CN-Regular, Source Han Sans CN;
  font-weight: 400;
  color: #00FFF7;
  text-align: center;
  width: 100%;
  height: 5vh;
}

.imgg {
  font-family: Source Han Sans CN-Regular, Source Han Sans CN;
  font-weight: 400;
  color: #FFFFFF;
  /*  垂直居中*/
  width: 100%;
  height: 5vh;
  display: flex;
}

.img_sun1 {

  background: #44D278;
  border-radius: 25px;
  width: 24%;
  height: vh(28.2);
  margin-top: 1vh;
  margin-left: 1vh;
}

.img_sun2 {
  width: 24%;
  height: vh(28.2);
  margin-top: 1vh;
  margin-left: 1vh;
  background: #FFC400;
  border-radius: 25px;
}

.img_sun3 {
  width: 24%;
  height: vh(28.2);
  margin-top: 1vh;
  margin-left: 1vh;
  background: #ff0000;
  border-radius: 25px;
}

.text_sun {
  width: 35%;
  height: 5vh;
  line-height: 5vh;
  margin-left: 1vh;
  font-size: 1.59vh;
}

.img {
  width: 3vh;
  height: 3vh;
  margin-top: 1vh;
  margin-left: 1vh;
}

.botTE2 {
  /*font-size: 2vh;*/
  height: vw(30);
  width: 100%;
  text-align: center;
}

#searAdressBox2 {
  top: vh(214.2) !important;
  right: 1vh !important;
  left: 1vh !important;
  bottom: auto !important;
  z-index: 1000;
  width: 13.5%;
  height: vh(220.2);
  line-height: 4vh;
  background-color: #000E48;
  border-radius: 10px 10px 10px 10px;

}
</style>
<style scoped lang="scss">
#searAdressBox3 {
  top: 1vh !important;
  right: auto !important;
  left: 1vh !important;
  bottom: auto !important;
  z-index: 1000;
  width: 13.5%;
  height: 4vh;
  line-height: 4vh;
  background-color: #000E48;
  border-radius: 2px 2px 2px 2px;
}

.swich {
  text-align: center;
  height: 2vh;
  width: 100%;
  color: #FFFFFF;
}
</style>
<style lang="scss">
//百度地图信息弹窗标题
.BMap_bubble_title {
  font-weight: 700 !important;
  margin-bottom: 10px;
  font-size: 16px;
}

.yX {
  text-align: center;
  margin: 1vh;
  /*margin-right: 1vh;*/
  width: 10vh;
  height: 22vh;
  background-color: #000E48;
  border-radius: 10px 10px 10px 10px;
  opacity: 0.9;
}

.d1 {
  margin-top: 1.6vh;
  margin-left: 1.5vh;
  width: 7.2vh;
  height: 3.3vh;
  background: #0090FF;
  border-radius: 15px 15px 15px 15px;
  opacity: 1;

}

.d1 div {
  display: inline-block;
  width: 5vh;
  height: 2vh;
  font-size: 2.2vh;
  font-family: Source Han Sans CN-Regular, Source Han Sans CN;
  font-weight: 400;
  color: #FFFFFF;
}

.d2 {
  margin-top: 1.6vh;
  margin-left: 1.5vh;
  width: 7.2vh;
  height: 3.3vh;
  background: #44D278;
  border-radius: 15px 15px 15px 15px;
  opacity: 1;
}

.d2 div {
  display: inline-block;
  width: 7.2vh;
  height: 3.3vh;
  font-size: 2.2vh;
  font-family: Source Han Sans CN-Regular, Source Han Sans CN;
  font-weight: 400;
  color: #FFFFFF;
}

.d3 {
  margin-top: 1.6vh;
  margin-left: 1.5vh;
  width: 7.2vh;
  height: 3.3vh;
  background: #FFC400;
  border-radius: 15px 15px 15px 15px;
  opacity: 1;
}

.d3 div {
  display: inline-block;
  width: 7.2vh;
  height: 3.3vh;
  font-size: 2.2vh;
  font-family: Source Han Sans CN-Regular, Source Han Sans CN;
  font-weight: 400;
  color: #FFFFFF;
}

.d4 {
  margin-top: 1.6vh;
  margin-left: 1.5vh;
  width: 7.2vh;
  height: 3.2vh;
  background: #FF0000;
  border-radius: 15px 15px 15px 15px;
  opacity: 1;
}

.d4 div {
  display: inline-block;
  width: 7.2vh;
  height: 3.3vh;
  font-size: 2.2vh;
  font-family: Source Han Sans CN-Regular, Source Han Sans CN;
  font-weight: 400;
  color: #FFFFFF;
}


/* 给个宽高 */
.bm-view {
  margin-left: vw(13);
  margin-top: vh(17);
  //height: vh(234.2*2+50);
  //width: 100%;
  width: vw(410*2);
  height: vh(269.2*2-20);
}

.text_T {
  font-size: 1.6vh;
  margin-left: 1vh;
  height: 3vh;
  width: 50%;

}

.img_M {
  margin-left: 1vh;
  height: 3vh;
  width: 15%;
}
</style>

